{% extends "toast/base.template.html" %}
{% load toast_filters %}


{% block breadcrumbs %}
	<li><a href="/toast/member/">Members</a> <span class="divider">/</span></li>
	<li class="active">{{ member.first_name_first }}</li>
{% endblock %}


{% block sidecontent %}
	<div class="btn-toolbar">
		<div class="btn-group">
			<a class="btn active" href="/toast/member/view/{{ member.id }}">View</a>
			<a class="btn" href="/toast/member/edit/{{ member.id }}">Edit</a>
			<a class="btn confirm" href="/toast/member/delete/{{ member.id }}" message="Are you sure you wanted to delete {{ member.first_name_first }}?">Delete</a>
		</div>
	</div>
	
	<h4>{{ member.first_name_first }}</h4>
	<p>E-Mail: {{ member.email }}</p>
	<p>Phone: {{ member.phone|format_phone }}</p>
{% endblock %}


{% block content %}
	{% if list_of_attendance %}
		<table class="table">
			<thead>
			<tr>
				<th>Meeting</th>
				<th>Role</th>
				<th>Action(s)</th>
			</tr>
			</thead>
			<tbody>
			{% for attendance in list_of_attendance %}
			<tr>
				<td><a href="/toast/meeting/view/{{ attendance.meeting.id }}">{{ attendance.meeting.name }}</a></td>
				<td>{{ attendance.role.name|ucwords }}</td>
				<td>
				<div class="btn-group pull-right">
				<a class="btn btn-primary" href="#"><i class="icon-wrench icon-white"></i> Actions</a>
				<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
				<ul class="dropdown-menu">
					<li><a href="/toast/attendance/view/{{ attendance.id }}"><i class="icon-eye-open"></i> View</a></li>
					<li><a href="/toast/attendance/edit/{{ attendance.id }}"><i class="icon-pencil"></i> Edit</a></li>
					<li><a href="/toast/attendance/delete/{{ attendance.id }}" class="confirm" message="Are you sure you want to delete {{ attendance.member.first_name_first }}'s attendance at {{ attendance.meeting.name }}?"><i class="icon-trash"></i> Delete</a></li>
				</ul>
			</div>
			<div class="clearfix"></div>
				</td>
			</tr>
			{% endfor %}
			</tbody>
		</table>
	{% else %}
		<p>Member does not have attendance at any meetings.</p>
	{% endif %}
{% endblock %}